package com.supor.aiot.food.api;

import com.android.baseconfig.base.BaseApiResult;
import com.android.baseconfig.base.DataApiResult;
import com.supor.aiot.common.app.Constants;
import com.supor.aiot.food.bean.AddBasketBean;
import com.supor.aiot.food.bean.BindDeviceBean;
import com.supor.aiot.food.bean.ChefDetailBean;
import com.supor.aiot.food.bean.ChildListBean;
import com.supor.aiot.food.bean.RecipeDeviceBean;
import com.supor.aiot.food.bean.RecipeHotBean;
import com.supor.aiot.food.bean.RecipeTopicBean;
import com.supor.aiot.food.bean.RequstChefBean;
import com.supor.aiot.food.bean.TopicDetailBean;
import com.supor.aiot.food.bean.RecipeStoreBean;

import java.util.List;

import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * ---------------------------------------------------------------- <br>
 * Copyright (C) 2014-2020, by het, Shenzhen, All rights reserved.  <br>
 * ---------------------------------------------------------------- <br>
 * <p>
 * 描述: IpsService <br>
 * 作者: lei <br>
 * 日期: 2021/9/7 <br>
 */
public interface SearchFoodService {

    /**
     * 查询用户信息
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "bossTUser/{id}")
    Observable<BaseApiResult<String>> getUserInfo(@Query(
            "id") String userid);

    /**
     * 二级分类查询食谱接口
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "foodTRecipeChannelLink/getRecipeInfo")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> checkRecipeClassify(@Query(
            "channelId") String id,@Query("page") int page,@Query("limit") int limit);

    /**
     *  所有分类查询接口
     */
    @GET(Constants.OSS_API + "foodTClassifications/json/pageList")
    Observable<BaseApiResult<DataApiResult<List<ChildListBean>>>> getAllClassify(@Query(
            "parentId") String parentId,@Query("limit") int limit);

    /**
     *  二级分类所有分类查询接口
     */
    @GET(Constants.OSS_API + "foodTRecipeChannelLink/getRecipeInfo")
    Observable<BaseApiResult<DataApiResult<List<ChildListBean>>>> getSecondaryAllClassify(@Query(
            "channelId") String parentId);

    /**
     *  热门食谱查询接口
     * @return BaseApiResult<DataApiResult<List<RecipeHotBean>>>>>
     */
    @GET(Constants.OSS_API + "foodTRecipe/hot")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getHotRecipe(@Query(
            "hot") String hot,@Query("page") int page,@Query("limit") int limit);

    /**
     *  寻味热门食谱查询接口
     * @return BaseApiResult<DataApiResult<List<RecipeHotBean>>>>>
     */
    @GET(Constants.OSS_API + "foodTRecipe/weekhotByPcCount")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getHotRecipeFood(@Query(
            "modelTypeId") String productModel,@Query("page") int page,@Query("limit") int limit);

    /**
     *  新寻味热门食谱查询接口 按照productModel
     * @return BaseApiResult<DataApiResult<List<RecipeHotBean>>>>>
     */
    @GET(Constants.OSS_API + "foodTRecipe/weekhotByPcCount")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getHotRecipeFoodNew(@Query(
            "productModel") String productModel,@Query("page") int page,@Query("limit") int limit);


    /**
     *  最新食谱查询接口
     *  foodTRecipe/getRecipesByModelId //大类 modelTypeId
     *  foodTRecipe/pageByProductModel //小类 productModel
     * @return BaseApiResult<DataApiResult<List<RecipeHotBean>>>>>
     */
    @GET(Constants.OSS_API + "foodTRecipe/getRecipesByModelId")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getNewRecipe(@Query(("modelTypeId")) String productModel,@Query("page") int page, @Query("limit") int limit);


    /**
     *  最新食谱查询接口 新按照productModel&type=new 指定型号查询最新的，是按RELEASE_TIME排序
     *
     * @return BaseApiResult<DataApiResult<List<RecipeHotBean>>>>>
     */
    @GET(Constants.OSS_API + "foodTRecipe/pageList")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getRecipeNew(
            @Query("productModel") String productModel, @Query("type") String type, @Query("page") int page, @Query("limit") int limit);


    /**
     *  最新食谱查询接口
     *  foodTRecipe/getRecipesByModelId //大类 modelTypeId
     *  foodTRecipe/pageByProductModel //小类 productModel
     * @return BaseApiResult<DataApiResult<List<RecipeHotBean>>>>>
     */
    @GET(Constants.OSS_API + "foodTRecipe/pageByProductModel")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getNewRecipeByProduct(@Query(("productModel")) String productModel,@Query("page") int page, @Query("limit") int limit);


    /**
     *  食谱模糊查询接口
     * @return BaseApiResult<DataApiResult<List<RecipeHotBean>>>>>
     */
    @GET(Constants.OSS_API + "foodTRecipe/pageByProductModel")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> searchRecipe(@Query(("productModel")) String productModel,
                                                                               @Query("recipeName") String recipeName,@Query("page") int page, @Query("limit") int limit);


    /**
     * 查询大家都在做食谱
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "foodTRecipe/peopleAllDo")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getPopularRecipe(@Query("page") int page, @Query("limit") int limit);


    /**
     * 美味上新
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "foodTRecipe/pageByProductModel")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getNewestRecipe(@Query("page") int page, @Query("limit") int limit);


    /**
     * 添加到菜篮子接口
     * @return BaseApiResult<String>
     */
    @POST(Constants.OSS_API + "foodTShoppingBasket")
    Observable<BaseApiResult<String>> addIntoBasket(@Body AddBasketBean basketBean);

    /**
     * 食谱收藏接口
     * @return BaseApiResult<String>
     */
    @POST(Constants.OSS_API + "bossTPublicFavorite")
    Observable<BaseApiResult<String>> recipeStore(@Body RecipeStoreBean storeBean);


    /**
     *  食谱取消收藏接口
     * @return BaseApiResult<DataApiResult<List<RecipeHotBean>>>>>
     */
    @GET(Constants.OSS_API + "bossTPublicFavorite/del/{id}")
    Observable<BaseApiResult<String>> cancleRecipeStore(@Path("id") int favorateId);


    /**
     * 美食专辑
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "foodTCuisine/pageList")
    Observable<BaseApiResult<DataApiResult<List<RecipeTopicBean>>>> getFoodRecords(@Query("remark") String remark,@Query("limit") int limit);

    /**
     * 查询寻味也视频食谱接口
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "foodTRecipe/pageList")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getVedioRecips(@Query("page") int page,@Query("limit") int limit,@Query("recipeType") String recipeType,@Query("recipeStatus") String recipeStatus);


    /**
     * 主厨主页
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "possTChef/pageList")
    Observable<BaseApiResult<DataApiResult<List<ChefDetailBean>>>> getChefDetail(@Query("chefId") String chefId);

    /**
     * 主厨列表
     * @return BaseApiResult<DataApiResult<List<ChefDetailBean>>>
     */
    @GET(Constants.OSS_API + "possTChef/pageList")
    Observable<BaseApiResult<DataApiResult<List<ChefDetailBean>>>> getChefList(@Query("page") int page, @Query("limit") int limit);

    /**
     * 美食专辑详情
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "foodTCuisine/pageList")
    Observable<BaseApiResult<DataApiResult<List<TopicDetailBean>>>> getTopicDetail(@Query("dataId") String dataId);

    /**
     * 美食专辑获取食谱列表
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "foodTRecipe/pageList")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getTopicRecipe(@Query("cuisineId") String cuisineId,@Query("page") int page,@Query("limit") int limit);

    /**
     * 私厨主页上新
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "foodTRecipe/pageList")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getCookerNew(@Query("chefId") String chefId,@Query("type") String type,@Query("page") int page,@Query("limit") int limit);

    /**
     * 私厨拿手好菜
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "foodTRecipe/pageList")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getCookerGood(@Query("chefId") String chefId,@Query("isChefOne") String type,@Query("page") int page,@Query("limit") int limit);


    /**
     * 求更新
     * @return BaseApiResult<String>
     */
    @POST(Constants.OSS_API + "foodTUserWantupdate")
    Observable<BaseApiResult<String>> requestUpdate(@Body RequstChefBean requstChefBean);

    /**
     * 获取食谱设备
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "bossTAppliancesModel/json/page")
    Observable<BaseApiResult<DataApiResult<List<RecipeDeviceBean>>>> getRecipeDevice(@Query("limit") int limit);

    /**
     * 获取未绑定设备
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "bossTModelType/getModelTypeList")
    Observable<BaseApiResult<List<BindDeviceBean>>> getUnbindDevice();

    /**
     * 获取未绑定设备
     * @return BaseApiResult<String>
     */
    @GET(Constants.OSS_API + "foodTRecipe/pageByProductModel")
    Observable<BaseApiResult<DataApiResult<List<RecipeHotBean>>>> getNewRecomond();

}
